﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace BusinessLogic
{
    public class Quyen
    {
        public DataTable Select()
        {
            SqlConnection con = DataAccess.Connection.OpenConnection();
            DataTable dt = new DataTable();
            try
            {
                
                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = "sp_Quyen_Select";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Connection = con;

                SqlDataAdapter adapter = new SqlDataAdapter(cmd);
                DataSet ds = new DataSet();

                adapter.Fill(ds, "Quyen");
                dt = ds.Tables["Quyen"];
            }
            catch
            {
                dt = null;
            }
            finally
            {
                con.Close();
            }
            return dt;
        }
    }
}
